package org.dyk.mallmanagementsystem.service.goods;

import org.dyk.mallmanagementsystem.model.Goods;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface GoodsService {
    //查询所有商品，并分页
    public Page<Goods> findAll(Pageable pageable);

    //查询所有商品
    public List<Goods> findAll();

    //根据主键获取商品信息
    public Goods findByGid(int gid);

    //添加商品
    public boolean insert(int tid, String goodsName, int goodsStock, String goodsPrice,
                          String goodsDescribe, MultipartFile goodsImg);

    //修改商品
    public boolean updata(int gid, int tid, String goodsName, int goodsStock, String goodsPrice, String goodsDescribe);

    //修改图片
    public boolean updataGoodsImg(int gid, MultipartFile goodsImg);

    //删除商品
    public boolean delete(int gid);

    //自定义查询商品
    public List<Goods> selectByGoods(String goodsName, int tid);
}
